/***
 * 房间管理api
 */
import request from "@/utils/request";

let village = '/service-village'

/**
 * 条件查询房屋信息
 * @param query
 * @returns {AxiosPromise}
 */
export function roomQuery(query){
  return request({
    url: village + '/village/room/queryRoom',
    method:'get',
    params: query
  })
}

/**
 * 添加房屋
 * @param room
 * @returns {AxiosPromise}
 */
export function addRooms(room){
  return request({
    url: village +'/village/room/addRoom',
    method:'post',
    data: room
  })
}

/**
 * 根据id获取房间id
 * @param roomId
 * @returns {AxiosPromise}
 */
export function getRoomById(roomId){
  return request({
    url: village + '/village/room/getRoomById/'+roomId,
    method:'get'
  })
}

/**
 * 修改房屋信息
 * @param room
 * @returns {AxiosPromise}
 */
export function updateRoomById(room){
  return request({
    url: village + '/village/room/updateRoomById',
    method:'post',
    data: room
  })
}

/**
 * 删除房屋信息
 * @param rId
 * @returns {AxiosPromise}
 */
export function deleteRoomById(rId){
  return request({
    url: village + '/village/room/deleteRoomById/'+rId,
    method: 'delete'
  })
}
